<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>家庭药品管理 - 首页</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="css/common.css">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#16a34a',
                        secondary: '#4ade80',
                        dark: '#1e293b',
                        light: '#f8fafc'
                    }
                }
            }
        }
    </script>
    <style>
        /* iPhone 15 模拟外壳样式 */
        .iphone-frame {
            width: 390px;
            height: 844px;
            border-radius: 44px;
            background-color: #000;
            margin: 20px auto;
            position: relative;
            overflow: hidden;
            box-shadow: 0 0 0 10px #111, 0 0 0 11px #333, 0 20px 50px rgba(0, 0, 0, 0.3);
        }
        
        /* 顶部刘海区域 */
        .iphone-notch {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 200px;
            height: 30px;
            background-color: #000;
            border-radius: 0 0 20px 20px;
            z-index: 10;
        }
        
        /* 底部安全区域 */
        .iphone-home-indicator {
            position: absolute;
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%);
            width: 120px;
            height: 5px;
            background-color: rgba(255, 255, 255, 0.6);
            border-radius: 5px;
            z-index: 10;
        }
        
        /* 顶部状态栏 */
        .iphone-status-bar {
            height: 50px;
            background-color: #fff;
            padding-top: 15px;
            padding-left: 20px;
            padding-right: 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 14px;
            font-weight: 600;
        }
        
        /* 内容区域 */
        .iphone-content {
            height: calc(100% - 50px - 83px);
            background-color: #f8fafc;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            padding: 20px;
        }
        
        /* 底部导航栏 */
        .iphone-nav {
            height: 83px;
            background-color: white;
            border-top: 1px solid #e5e7eb;
            display: flex;
            justify-content: space-around;
            align-items: center;
            position: absolute;
            bottom: 0;
            width: 100%;
        }
        
        /* 导航项样式 */
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: #9ca3af;
            text-decoration: none;
            font-size: 12px;
        }
        
        .nav-item.active {
            color: #16a34a;
        }
        
        .nav-item i {
            font-size: 22px;
            margin-bottom: 5px;
        }
        
        /* 页面头部样式 */
        .page-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        
        .page-header h1 {
            font-size: 24px;
            font-weight: 700;
            color: #1e293b;
        }
        
        /* 欢迎区域样式 */
        .welcome-section {
            background: linear-gradient(135deg, #16a34a, #2dd4bf);
            border-radius: 20px;
            padding: 24px;
            color: white;
            margin-bottom: 24px;
        }
        
        .welcome-text {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .welcome-subtext {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 16px;
        }
        
        /* 数据概览卡片样式 */
        .stats-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 24px;
        }
        
        .stat-card {
            background-color: white;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        .stat-value {
            font-size: 24px;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 4px;
        }
        
        .stat-label {
            font-size: 12px;
            color: #64748b;
        }
        
        /* 最近用药提醒样式 */
        .reminder-section {
            background-color: white;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            margin-bottom: 24px;
        }
        
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        
        .section-title {
            font-size: 16px;
            font-weight: 600;
            color: #1e293b;
        }
        
        .view-all {
            font-size: 14px;
            color: #16a34a;
            text-decoration: none;
        }
        
        .reminder-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f1f5f9;
        }
        
        .reminder-item:last-child {
            border-bottom: none;
        }
        
        .reminder-info {
            flex: 1;
        }
        
        .reminder-title {
            font-size: 14px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 4px;
        }
        
        .reminder-time {
            font-size: 12px;
            color: #64748b;
        }
        
        .reminder-action {
            background-color: #f1f5f9;
            border-radius: 20px;
            padding: 8px 16px;
            font-size: 12px;
            font-weight: 600;
            color: #16a34a;
        }
        
        /* 过期药品提醒样式 */
        .expired-section {
            background-color: white;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }
        
        .expired-item {
            display: flex;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #f1f5f9;
        }
        
        .expired-item:last-child {
            border-bottom: none;
        }
        
        .expired-icon {
            width: 48px;
            height: 48px;
            background-color: #fee2e2;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 12px;
        }
        
        .expired-icon i {
            font-size: 20px;
            color: #ef4444;
        }
        
        .expired-info {
            flex: 1;
        }
        
        .expired-name {
            font-size: 14px;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 4px;
        }
        
        .expired-date {
            font-size: 12px;
            color: #ef4444;
        }
        
        /* 紧急处理按钮样式 */
        .urgent-action {
            background-color: #fee2e2;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .urgent-action i {
            font-size: 16px;
            color: #ef4444;
        }
    </style>
</head>
<body>
    <div class="iphone-frame">
        <!-- 顶部刘海 -->
        <div class="iphone-notch"></div>
        
        <!-- 状态栏 -->
        <div class="iphone-status-bar">
            <div>9:41</div>
            <div class="flex space-x-2">
                <i class="fa fa-signal"></i>
                <i class="fa fa-wifi"></i>
                <i class="fa fa-battery-full"></i>
            </div>
        </div>
        
        <!-- 内容区域 -->
        <div class="iphone-content">
            <!-- 页面头部 -->
            <div class="page-header">
                <h1>家庭药品管理</h1>
                <div class="flex space-x-4">
                    <button id="searchButton" class="w-8 h-8 flex items-center justify-center">
                        <i class="fa fa-search text-gray-600"></i>
                    </button>
                    <button id="notificationButton" class="w-8 h-8 flex items-center justify-center">
                        <i class="fa fa-bell text-gray-600"></i>
                    </button>
                </div>
            </div>
            
            <!-- 欢迎区域 -->
            <div class="welcome-section">
                <div class="welcome-text">你好，王先生</div>
                <div class="welcome-subtext">今天是个健康的开始！</div>
            </div>
            
            <!-- 数据概览 -->
            <div class="stats-grid">
                <div class="stat-card">
                    <div class="stat-value">28</div>
                    <div class="stat-label">药品总数</div>
                </div>
                <div class="stat-card">
                    <div class="stat-value">3</div>
                    <div class="stat-label">今日提醒</div>
                </div>
                <div class="stat-card">
                    <div class="stat-value">5</div>
                    <div class="stat-label">家庭成员</div>
                </div>
                <div class="stat-card">
                    <div class="stat-value">2</div>
                    <div class="stat-label">即将过期</div>
                </div>
            </div>
            
            <!-- 最近用药提醒 -->
            <div class="reminder-section">
                <div class="section-header">
                    <div class="section-title">今日用药提醒</div>
                    <a href="reminder.html" class="view-all">查看全部</a>
                </div>
                
                <div class="reminder-item">
                    <div class="reminder-info">
                        <div class="reminder-title">布洛芬缓释胶囊</div>
                        <div class="reminder-time">12:00</div>
                    </div>
                    <div class="reminder-action">服用</div>
                </div>
                
                <div class="reminder-item">
                    <div class="reminder-info">
                        <div class="reminder-title">复合维生素B片</div>
                        <div class="reminder-time">18:00</div>
                    </div>
                    <div class="reminder-action">服用</div>
                </div>
                
                <div class="reminder-item">
                    <div class="reminder-info">
                        <div class="reminder-title">盐酸氨溴索口服溶液</div>
                        <div class="reminder-time">20:00</div>
                    </div>
                    <div class="reminder-action">服用</div>
                </div>
            </div>
            
            <!-- 过期药品提醒 -->
            <div class="expired-section">
                <div class="section-header">
                    <div class="section-title">过期提醒</div>
                    <a href="medicine_management.html" class="view-all">查看全部</a>
                </div>
                
                <div class="expired-item">
                    <div class="expired-icon">
                        <i class="fa fa-medkit"></i>
                    </div>
                    <div class="expired-info">
                        <div class="expired-name">感冒清热颗粒</div>
                        <div class="expired-date">已过期5天</div>
                    </div>
                    <div class="urgent-action">
                        <i class="fa fa-trash"></i>
                    </div>
                </div>
                
                <div class="expired-item">
                    <div class="expired-icon">
                        <i class="fa fa-medkit"></i>
                    </div>
                    <div class="expired-info">
                        <div class="expired-name">小儿止咳糖浆</div>
                        <div class="expired-date">已过期12天</div>
                    </div>
                    <div class="urgent-action">
                        <i class="fa fa-trash"></i>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 底部导航栏 -->
        <div class="iphone-nav">
            <a href="index.html" class="nav-item active">
                <i class="fa fa-home"></i>
                <span>首页</span>
            </a>
            <a href="medicine_management.html" class="nav-item">
                <i class="fa fa-medkit"></i>
                <span>药品</span>
            </a>
            <a href="add_medicine.html" class="nav-item">
                <i class="fa fa-plus"></i>
                <span>添加</span>
            </a>
            <a href="reminder.html" class="nav-item">
                <i class="fa fa-bell"></i>
                <span>提醒</span>
            </a>
            <a href="profile.html" class="nav-item">
                <i class="fa fa-user"></i>
                <span>我的</span>
            </a>
        </div>
        
        <!-- 底部安全指示器 -->
        <div class="iphone-home-indicator"></div>
    </div>

    <script>
        // 搜索按钮点击事件
        document.getElementById('searchButton').addEventListener('click', function() {
            console.log('用户点击了搜索按钮');
            alert('打开搜索页面');
        });
        
        // 通知按钮点击事件
        document.getElementById('notificationButton').addEventListener('click', function() {
            console.log('用户点击了通知按钮');
            alert('查看通知');
        });
        
        // 提醒项点击事件
        const reminderItems = document.querySelectorAll('.reminder-item');
        reminderItems.forEach(item => {
            item.addEventListener('click', function() {
                const medicineName = this.querySelector('.reminder-title').textContent;
                console.log('用户点击了提醒项:', medicineName);
                // 在实际应用中，这里会跳转到药品详情页或记录用药情况
                alert('记录' + medicineName + '的用药情况');
            });
        });
        
        // 过期药品删除按钮点击事件
        const deleteButtons = document.querySelectorAll('.urgent-action');
        deleteButtons.forEach(button => {
            button.addEventListener('click', function(e) {
                e.stopPropagation(); // 阻止事件冒泡到父元素
                const medicineName = this.closest('.expired-item').querySelector('.expired-name').textContent;
                console.log('用户点击了删除按钮:', medicineName);
                // 在实际应用中，这里会弹出确认对话框并执行删除操作
                if (confirm('确定要删除过期药品' + medicineName + '吗？')) {
                    alert('药品已删除');
                }
            });
        });
        
        // 过期药品项点击事件
        const expiredItems = document.querySelectorAll('.expired-item');
        expiredItems.forEach(item => {
            item.addEventListener('click', function() {
                const medicineName = this.querySelector('.expired-name').textContent;
                console.log('用户点击了过期药品项:', medicineName);
                // 在实际应用中，这里会跳转到药品详情页
                alert('查看' + medicineName + '的详细信息');
            });
        });
    </script>
</body>
</html>